﻿using System;

namespace PhoenixCrabV6.Engine.IO
{
    /// <summary>
    /// Manages the serialization/deserialization of classes T and subtypes
    /// </summary>
    /// <typeparam name="T">Serializes/Deserializes class T and subtypes</typeparam>
    public interface IXmlManager<T>
    {
        /// <summary>
        /// The class type of the item currently being serialized/deserialized
        /// </summary>
        Type Type { get; set; }

        /// <summary>
        /// Deseralizes an XML file and enters the info into a new object of type T
        /// </summary>
        /// <param name="path">The path of file to deserialize</param>
        /// <returns>Object of type T built from Deserialized XML</returns>
        T Load(string path);

        /// <summary>
        /// Serializes object into XML File
        /// </summary>
        /// <param name="path">path to the XML file</param>
        /// <param name="obj">object to be serialized</param>
        void Save(string path, T obj);
    }
}